package com.ai.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.ForumSorterPostService;
import com.ai.web.vo.ForumSorterPostV;
import com.ai.web.vo.ResultModel;
import com.tiny.persistence.domain.ForumSorterPost;
import com.tiny.persistence.repository.ForumSorterPostRepo;

@Service
public class ForumSorterPostServiceImpl extends BaseServiceImpl<ForumSorterPost, Integer, ForumSorterPostV> implements ForumSorterPostService  {

    @Autowired
    private ForumSorterPostRepo forumSorterPostRepo;
    
    @Autowired
    public ForumSorterPostServiceImpl(ForumSorterPostRepo forumSorterPostRepo) {
        super(forumSorterPostRepo);
    }

    public ForumSorterPostV getForumSorterPost(int userId) throws Exception {
        return getT(userId);
    }

    public ResultModel saveForumSorterPost(ForumSorterPostV forumSorterPostV) throws Exception {
        
        ForumSorterPostV saveV = saveT(forumSorterPostV);
        
        ResultModel rm = new ResultModel();
        rm.setData(saveV);
        rm.setSuccessCode();
        
        return rm;
    }

    public ResultModel deleteForumSorterPosts(List<Integer> userIds) throws Exception {
        deleteTs(userIds);
        
        ResultModel rm = new ResultModel();
        rm.setSuccessCode();
        rm.setMsg("删除成功！");
        
        return rm;
    }

}
